<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*" %>
<%@ include file="/inc/taglibs.jsp"%>
<script type="text/javascript">
	
</script>

<form id="pagerForm" method="post" action="${path }/admin/userMessageDm">
	<input type="hidden" name="eqReceiverType" value="${eqReceiverType }" />
	<input type="hidden" name="pageNum" value="${pageTurn.page }" />
	<input type="hidden" name="numPerPage" value="${pageTurn.pageSize }" />
	<input type="hidden" name="rel" value="${rel }" />
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="${path }/admin/userMessageDm" method="post">
	<div class="searchBar">
		<table class="searchContent">
			<tr>
				<td>
                    <label>接收人：</label>
					<select  name="eqReceiverType" id="eqReceiverType" class="combox">
						<option value="">请选择</option>
						<c:forEach items="${userMessageReceiverTypeMap}" var="entry">
							<option value="${entry.key}">${entry.value}</option>
						</c:forEach>
					</select>
					<script type="text/javascript">
						jQuery('#eqReceiverType').val("${eqReceiverType }");
					</script>
                </td>
                <td>
					开始时间：
				</td>
				<td>
					<input type="text" value="${gtCreateTime}" name="gtCreateTime" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true" style="float:left;"/>
					<a class="inputDateButton" href="javascript:;" style="float:left;">选择</a>
				</td>
				<td>
					结束时间：
				</td>
				<td>
					<input type="text" value="${ltCreateTime}" name="ltCreateTime" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true" style="float:left;"/>
					<a class="inputDateButton" href="javascript:;" style="float:left;">选择</a>
				</td>
				<td>
					<div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
				</td>
			</tr>
		</table>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="${path }/admin/userMessageDm/edit.do?rel=${rel}" rel="${rel}" target="dialog" width="610" height="550"><span>添加</span></a></li>
			<li><a class="delete" href="${path }/admin/userMessageDm/delete.do?rel=${rel}" target="selectedTodo" rel="ids" title="确定删除?"><span>删除</span></a></li>
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="115">
  		<thead>
			<tr>
				<th>ID<label style="float:left"><input type="checkbox" class="checkboxCtrl" group="ids" /></label></th>
				<th>发送人</th>
				<th>发件人</th>
				<th>接收人类型</th>
				<th>创建时间</th>
				<th>发送时间</th>
				<th>过期时间</th>
				<th>发送类型</th>
				<th>发送平台</th>
				<th width="180">操作</th>
			</tr>
		</thead>
		  <tbody> 
	  		<jsp:useBean id="now" class="java.util.Date" />
  			<c:choose>
				<c:when test="${null==userMessageDmList||userMessageDmList.isEmpty()}">
					<tr class="tatr2">
						<td colspan="10" align="center">暂无数据</td>
					</tr>
				</c:when>
				<c:otherwise>
					<c:forEach items="${userMessageDmList}" var="userMessageDmList">
						<tr target="id" rel="${userMessageDmList.id}">
						<td>
							<input type="checkbox" name="ids" id="ids" value="${userMessageDmList.id}"/>${userMessageDmList.id}
						</td>
						<td>${userMessageDmList.sender}</td>
						<td>${userMessageDmList.senderId}</td>
						<td>${userMessageReceiverTypeMap[userMessageDmList.receiverType]}</td>
						<td>
							<fmt:formatDate value="${userMessageDmList.createTime}" pattern="yyyy-MM-dd HH:mm:ss" />
						</td>
						<td>
							<fmt:formatDate value="${userMessageDmList.sendTime}" pattern="yyyy-MM-dd HH:mm:ss" />
						</td>
						<td>
							<fmt:formatDate value="${userMessageDmList.overTime}" pattern="yyyy-MM-dd HH:mm:ss" />
						</td>
						<td>${userMessageSendTypeMap[userMessageDmList.sendType]}</td>
						<td>${applicablePlatformMap[userMessageDmList.applicableId]}</td>
						<td>
						<c:if test="${now lt userMessageDmList.sendTime}" var="rs">  
							<a title="修改" target="dialog" href="${path}/admin/userMessageDm/edit?id=${userMessageDmList.id}&rel=${rel}" rel="${rel}"  width="610" height="550"><span>修改</span></a>&nbsp;
							<a title="添加内容" target="dialog" href="${path}/admin/userMessageDm/content/edit?id=${userMessageDmList.contentId}&dmId=${userMessageDmList.id }&rel=${rel}" rel="${rel}"  width="610" height="550"><span>添加内容</span></a>&nbsp;
							<c:if test="${userMessageDmList.receiverType==2}">
								<a title="添加收件人" rel="userList" target="navTab" mask="true" href="/admin/userMessageDmReceiver?eqDmId=${userMessageDmList.id}">添加收件人</a>
							</c:if>
							<c:if test="${userMessageDmList.receiverType==3}">
								<a title="修改收件人" rel="userList" target="navTab" mask="true" href="/admin/userMessageDmReceiver?eqDmId=${userMessageDmList.id}&type=1">修改收件人</a>
							</c:if>
						</c:if>
						<c:if test="${now gt userMessageDmList.sendTime}" var="rs1"> 
							<c:if test="${userMessageDmList.receiverType==3 || userMessageDmList.receiverType==2}">
								<a title="查看收件人" rel="userList" target="navTab" mask="true" href="/admin/userMessageDmReceiver?eqDmId=${userMessageDmList.id}&type=1&view=1">查看收件人</a>
							</c:if>
							<a title="查看内容" target="dialog" href="${path}/admin/userMessageDm/content/edit?id=${userMessageDmList.contentId}&dmId=${userMessageDmList.id }&rel=${rel}&view=1" rel="${rel}"  width="610" height="550"><span>查看内容</span></a>&nbsp;
						</c:if>
						</td></tr>
					</c:forEach>
				</c:otherwise>
			</c:choose>
		</tbody>
	</table>

    <div style="clear:both"></div>
    <div class="panelBar">
        <%@ include file="/inc/admin_pagination.jsp" %>
    </div>
</div>

